package com.awo.blackfacedetect.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.awo.blackfacedetect.R;
import com.awo.blackfacedetect.util.ActivityCollector;
import com.awo.facedetect.activity.FaceDetectActivity;
import com.awo.loglibrary.LogActivity;

public class SelectActivity extends MainActivity implements View.OnClickListener{
    Button btn_change,btn_opt,btn_in,btn_delete,btn_out;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_select);
        btn_change=findViewById(R.id.Log);
        btn_change.setOnClickListener(this);

        btn_in=findViewById(R.id.recognition);
        btn_in.setOnClickListener(this);

        btn_opt=findViewById(R.id.diagnosis);
        btn_opt.setOnClickListener(this);

        btn_delete=findViewById(R.id.contact);
        btn_delete.setOnClickListener(this);

        btn_out=findViewById(R.id.out);
        btn_out.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if(v.getId()==R.id.Log){
            Intent in=new Intent(this, LogActivity.class);
            startActivity(in);
        }
        else if(v.getId()==R.id.recognition){
            Intent in=new Intent(this, FaceDetectActivity.class);
            startActivity(in);
        }
        else  if(v.getId()==R.id.diagnosis){
//            Intent in=new Intent(this,diagnosis.class);
//            startActivity(in);
            Toast.makeText(SelectActivity.this, getString(R.string.notImplementThisFeature), Toast.LENGTH_SHORT).show();
        }else if(v.getId()==R.id.contact){
//            Intent in=new Intent(this,contact.class);
//            startActivity(in);
            Toast.makeText(SelectActivity.this, getString(R.string.notImplementThisFeature), Toast.LENGTH_SHORT).show();
        }
        else{
            //退出程序
            ActivityCollector.finishAll();
        }
    }
}